package com.smooth.dao.genx;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.smooth.dao.genx.bean.HotCompRsp;

public interface GxCompMapper {
	@Select({"<script>",
		"select * from biz_company as  d LEFT JOIN" ,
		"(select count(1) as jobCount,comp_id from biz_job  where job_status=1 ",
		"<if test='cityId != null'> and city_id ='${cityId}'</if>",
		" GROUP BY comp_id) as c on d.id=c.comp_id" ,
		"where 1=1 " ,
		"<if test='queryStr != null'> and comp_name  like '%${queryStr}%'</if>",
		"<if test='cityId != null'> and d.city_id ='${cityId}'</if>",
		"ORDER BY jobCount desc limit ${offset},${limit}" ,
		"</script>"
	})
	public List<HotCompRsp> queryRootCollegeProvinces(@Param("cityId") String cityId,@Param("queryStr") String queryStr,@Param("limit") Integer limit,@Param("offset") Integer offset);
}
